* D:\E\replications\BJPS2020\resultsets\figures\graph_export.do

// This file opens the Stata-graphs, and saves them in various formats
* cd D:/E/replications/BJPS2020/
clear all
cd ./resultsets/figures/
fs *.gph
foreach f in `r(files)' {
	graph use `f'
	local n: subinstr local f ".gph" "", all
	di "`n'.`v'"
	foreach v in ///
		ps  /// PostScript
		eps /// EPS (Encapsulated PostScript)
		svg /// SVG (Scalable Vector Graphics)
		wmf /// Windows Metafile
		emf /// Windows Enhanced Metafile
		pdf /// PDF (Portable Document Format)
		png /// PNG (Portable Network Graphics)
		tif /// TIFF (Tagged Image File Format)
		{
		cap noisily mkdir `v'
		graph export ./`v'/`n'.`v', replace
	}
}
cd ..
cd ..
